package com.ygg.cps.afx.exception;

import java.util.HashMap;
import java.util.Map;

public class BasicException extends Exception
{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    
    /**
     * 保存异常的错误信息
     */
    protected Map<String, Object> causeMapInfo = new HashMap<String, Object>();
    
    public BasicException()
    {
        super();
    }
    
    public BasicException(String message, Throwable cause)
    {
        super(message, cause);
    }
    
    public BasicException(String message)
    {
        super(message);
    }
    
    public BasicException(Throwable cause)
    {
        super(cause);
    }
    
    public Map<String, Object> getCauseMapInfo()
    {
        return causeMapInfo;
    }
    
    public void addCause(String key, Object causeInfo)
    {
        this.causeMapInfo.put(key, causeInfo);
    }
    
    public void addCause(String key, String causeInfo)
    {
        this.causeMapInfo.put(key, causeInfo);
    }
    
    public void addCause(String key, Integer causeInfo)
    {
        this.causeMapInfo.put(key, causeInfo);
    }
    
    public void addCause(String key, Long causeInfo)
    {
        this.causeMapInfo.put(key, causeInfo);
    }
    
    public void addCause(String key, boolean causeInfo)
    {
        this.causeMapInfo.put(key, causeInfo);
    }
}
